<!DOCTYPE html>
<html>
  <head>
    <title>Listing 7.2</title>
    <script type="text/javascript" src="../scripts/assert.js"></script>
    <link href="../styles/assert.css" rel="stylesheet" type="text/css">
  </head>
  <body>
    <script type="text/javascript">

      var re1 = /test/i;                           //#1

      var re2 = new RegExp("test", "i");           //#2

      assert(re1.toString() == "/test/i",
             "Verify the contents of the expression.");
      assert(re1.test("TesT"), "Yes, it's case-insensitive.");
      assert(re2.test("TesT"), "This one is too.");
      assert(re1.toString() == re2.toString(),
            "The regular expressions expressions are equal.");
      assert( re1 != re2, "But they are different objects.");
    </script>
  </body>
</html>
